<?php
class DbConfig {

	private static $instance;
	
	private $url;
	private $username;
	private $password;
	private $dbname;
	

	private function __construct() {
		
		//load hodnot z externiho filu - napr. database.ini
		
		//zatim natvrdo
		$this->url = 'localhost';
		$this->username = 'root';
		$this->password = 'or53bit';
		$this->dbname = 'wrshop';
				
	}

	private function __clone() {
		//overide clone metody, kvuli tomu aby se nedala udelat jina instance
	}
	
	
	public static function getInstance() {
		if (!self :: $instance instanceof self) {
			self :: $instance = new self;
		}
		return self :: $instance;
	}
	
	
	public function getDbUrl() {
		return $this->url;
	}
	
	public function getDbUsername(){
		return $this->username;
	}

	public function getDbPassword(){
		return $this->password;
	}
	
	public function getDbName(){
		return $this->dbname;
	}

}

?>
